package innerClass;
//成员内部类
public class Outer {
    public static void main(String[] args){
        Face f = new Face();
        Face.Nose m = f.new Nose();
        m.breath();

        Face.Nose n = new Face().new Nose();
        n.breath();

        //静态内部类调用
        Face.Ear e = new Face.Ear();
        e.listen();
    }
}

class Face{
    int type;
    String shape = "鹅蛋脸";
    static String color = "red";

    class Nose{
        String type;
        void breath(){
            System.out.println(Face.this.type);//使用外部类的东西,不重名可以直接打印type
            System.out.println("呼吸");
        }
    }

    //静态内部类
    static class Ear{
        void listen(){
            System.out.println(color);
            System.out.println("听");
        };
    }
}
